<div class="notice vm">
	<h1><span></span>消息通知</h1>

	<div class="con">
		<!-- 表格头部信息 -->
		<div class="tb_hd">
			<div class="devs">消息数量 ：<span>{{number}}</span></div>
			<div class="search">
				<input type="text" ng-model="search" placeholder="精准搜索">
				<button class="sh" >搜索更多</button>
				<button class="add" ng-click="addUser(true)">添加</button>
				<button class="del" ng-click="delUser()">删除</button>
			</div>
			<div class="filter">
				<span class="fl">行数:</span>
				<select ng-model="lineNumber" ng-options="x for x in lineNumbers"></select>
			</div>
		</div>

		<!-- 表格主要部分 -->
		<table>
			<tr>
				<th>
					<input type="checkbox" class="allCheck">
				</th>
				<th>消息标题</th>
				<th>作者</th>
				<th>消息内容</th>
				<th>创建时间</th>
				<th>操作</th>
			</tr>
			<tr ng-repeat="x in opints | filter : search | limitTo : lineNumber" userID="{{x.id}}">
				<td>
					<input type="checkbox">
				</td>
				<td>{{x.title}}</td>
				<td>{{x.autho}}</td>
				<td>{{x.notice}}</td>
				<td>{{x.time}}</td>
				<td>
					<a href="javascript:void(null)">推送</a>
					<a href="javascript:void(null)" ng-click="write(x)">编辑</a>
					<a href="javascript:void(null)">删除</a>
				</td>
			</tr>
		</table>
		<div class="tb_ft" ng-show="!hasSign">
			<span class="fr">
				<a class="fl unactive" ng-if="nowPage == maxPage">下一页</a>
				<a class="fl" ng-if="nowPage != maxPage">下一页</a>
			</span>
			<ul class="fr pages">
				<li>
					<a class="fl nowpage" ng-if="nowPage == 1">1</a>
					<a class="fl" ng-if="nowPage != 1">1</a>
				</li>
				<li style="color: #ccc;" ng-show="beforeLi">...</li>
				<li ng-repeat="x in pageArr">
					<a class="fl nowpage" ng-if="x == nowPage">{{x}}</a>
					<a class="fl" ng-if="x != nowPage">{{x}}</a>
				</li>
				<li style="color: #ccc;" ng-show="afterLi">...</li>
				<li ng-show="hasLastPage">
					<a class="fl nowpage" ng-if="nowPage == maxPage">{{maxPage}}</a>
					<a class="fl" ng-if="nowPage != maxPage">{{maxPage}}</a>
				</li>
			</ul>
			<span class="fr">
				<a class="fl unactive" ng-if="nowPage == 1">上一页</a>
				<a class="fl" ng-if="nowPage != 1">上一页</a>
			</span class="fr">
			<span>{{nowPage}}/{{maxPage}}</span>
		</div>

		<form class="adduser" name='userform' novalidate ng-show="addForm">
			<h3>新建消息</h3>
			<em ng-click="addUser(false)">✖</em>
			
			<div class="getID clearfix">
				<label>所有用户<input type="radio" name="getID" value="所有用户" checked="checked" ng-click="checkUs = false"></label>
				<label>指定用户<input type="radio" name="getID" value="指定用户" ng-click="checkUs = true"></label>
			</div>
			<textarea ng-show="checkUs" name="usersIDS" ng-model="usersIDS" ng-focus="accBool(false)" ng-blur="accBool(true)" required></textarea>
			<div class="errorBox" ng-show="checkUs">
			  	<span style="color:red;font-size:12px;" ng-show="userform.accBlur && userform.usersIDS.$dirty">
			    	<span ng-show="userform.usersIDS.$error.required">请输入消息要通知的用户ID</span>
			  	</span>
		   	</div>
			
			<div class="fbody clearfix">
				<label for="nt_title">消息标题:</label>
				<input type="text" name='nt_title' id="nt_title" ng-model="nt_title" ng-focus="devBool(false)" ng-blur="devBool(true)" required>
				<div class="errorBox">
				    <span style="color:red;font-size:12px;" ng-show="userform.devBlur && userform.nt_title.$dirty">
				    	<span ng-show="userform.nt_title.$error.required">请填写消息标题</span>
				    </span>
		   		</div>

		   		<label for="nt_str">消息内容:</label>
		   		<textarea name="nt_str" id="nt_str" ng-model="nt_str" ng-focus="addressBool(false)" ng-blur="addressBool(true)" required></textarea>
				 <div class="errorBox">
				    <span style="color:red;font-size:12px;" ng-show="userform.addressBlur && userform.nt_str.$dirty">
				    	<span ng-show="userform.nt_str.$error.required">请填写消息内容</span>
				    </span>
		   		</div>
			</div>

	   		<div class="fm_ft">
	   			<button ng-click="addUser(false)">取消</button>
	   			<button ng-disabled="userform.$invalid">保存</button>
	   			<button ng-disabled="userform.$invalid" ng-click="propNt()">推送</button>
	   		</div>
		</form>

		<div class="nothing" ng-show="hasSign">
			对不起，没有获取到你要的信息
		</div>
	</div>
</div>